package com.bnyy.message.bean.chat.message_data;

import com.bnyy.message.bean.chat.message_data.MessageData;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.lang.reflect.Field;

/**
 * Author : 关炳鹏
 * Description :
 * Date : 2022/12/6
 **/
public class GoodsMessage extends MessageData {

    interface ColumnName {
        String GOODS_ID = "id";
        String IMG = "img";
        String NAME = "name";
        String PRICE = "price";
        String TITLE = "title";
    }

    public GoodsMessage() {
    }

    public GoodsMessage(String msgId, JsonObject jsonObject) {
        super(msgId, jsonObject);

        this.goodsId = jsonObject.get(ColumnName.GOODS_ID).getAsInt();
        this.price = jsonObject.get(ColumnName.PRICE).getAsFloat();
        this.img = jsonObject.get(ColumnName.IMG).getAsString();
        this.name = jsonObject.get(ColumnName.NAME).getAsString();
        this.title = jsonObject.get(ColumnName.TITLE).getAsString();
    }

    @Column(name = ColumnName.GOODS_ID)
    @SerializedName("id")
    private int goodsId;

    @Column(name = ColumnName.IMG)
    private String img;

    @Column(name = ColumnName.NAME)
    private String name;

    @Column(name = ColumnName.PRICE)
    private float price;

    @Column(name = ColumnName.TITLE)
    private String title;

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }


}
